# coding: utf-8

from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()

class User(Base):
    __tablename__ = 'users'

    id = Column(Integer, primary_key=True)
    username = Column(String(32), nullable = False, index = True, unique = True)
    password = Column(String(32), nullable = False)

    def __init__(self, username, password):
        self.username = username
        self.password = password

    def __repr__(self):
        return "<User('%s, %s')" % (self.username, self.password)

if __name__ == "__main__":
    import sys, os
    sys.path.append("..")
    from models_ds import engine
    metadata = Base.metadata
    metadata.create_all(engine)

